package org.example.util;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Auther:Liu
 * @Testname:JsonResult
 * @Date:2025/7/29 11:08
 */
@Data
@NoArgsConstructor
public class JsonResult<T> implements Serializable {
    private Boolean success;
    private T data;
    private Integer code;
    private String error;

    public JsonResult(T data) {
        this.success = true;
        this.data=data;
        this.code=200;
    }public JsonResult(Integer code, String error) {
        this.success = false;
        this.code = code;
        this.error = error;
    }

}
